# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-model-bakery
_pyname="model_bakery"
pkgver=1.18.0
pkgrel=0
arch="noarch"
pkgdesc="Smart object creation facility for Django"
url="https://pypi.python.org/project/model-bakary"
license="Apache-2.0"
depends="py3-django"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
	py3-hatchling
	"
checkdepends="
	black
	py3-pytest-django
	py3-coverage
	py3-pillow
	py3-mypy
	ruff
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/model-bakers/model_bakery/archive/refs/tags/$pkgver.tar.gz
	"
builddir="$srcdir"/$_pyname-$pkgver
subpackages="$pkgname-pyc"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}
sha512sums="
1273a219b343b4ca3432c1ae04efb154304b67b289accd3e1a18bddd6214dd5a3f5085306de01f4aed0199ae6a89b2ca2f759185e27a5b419cf50c94dba2d3b1  py3-model-bakery-1.18.0.tar.gz
"
